<template>
  <el-tabs v-model="activeName" type="border-card" @tab-click="handleActive">
    <el-tab-pane label="物资明细信息" name="materials">
      <Materials ref="materials" />
    </el-tab-pane>
    <el-tab-pane label="服务明细信息" name="employ">
      <Employ ref="employ" />
    </el-tab-pane>
  </el-tabs>
</template>
<script>

import Materials from './materials'
import Employ from './employ'

export default {
  name: 'Exclusive',
  components: { Materials, Employ },
  data() {
    return {
      activeName: 'materials'
    }
  },
  methods: {
    handleActive(val) {
      this.$refs[val.name].getList()
    },
    getList() {
      this.$nextTick(() => {
        this.handleActive({ name: 'materials' })
      })
    }
  }
}
</script>
